<?php
    $attack = $_POST['attack'];
    $defense = $_POST['defense'];
    $roll = rand(2,12); 
    echo (($attack+$roll) >= $defense) ? 'Hit' : 'Miss';
?>